]> dgit.raspbian.org Git - gnome-shell.git/commit
panel: programmatic anim. control of AnimatedIcon
authorStéphane Démurget <stephane.demurget@free.fr>
Mon, 5 Nov 2012 22:11:27 +0000 (23:11 +0100)
committerStéphane Démurget <stephane.demurget@free.fr>
Sat, 17 Nov 2012 21:26:55 +0000 (22:26 +0100)
commitc48a246ccbee618956eefdb496770cc8d2694ec6
treef0dde5a31cacbd889b290ad5b525dac975e4609e
parentf084011a6115c4f157ca271b6cf69341aba91d2f
panel: programmatic anim. control of AnimatedIcon

The AnimatedIcon does not have an API for controlling the animation but
relies on the :visible property changes to start and stop a timeout used
to update the frame.

This has the inconvenient of having a side effect when visible is set to
true multiple times, and is not really the API expected from such
component. Also, there is a race if it is displayed before the images
are loaded: there is no child yet and thus we get this._frame = NaN
which leads to a crash.

Switch to a play/stop API instead, and add a load event callback to the
TextureCache.load_slice_image to exactly know when we can start using
the images.

https://bugzilla.gnome.org/show_bug.cgi?id=687583
js/ui/panel.js
src/st/st-texture-cache.c
src/st/st-texture-cache.h